﻿using AbpToDomain.CustomEntityInfo;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace AbpEntityFrameworkcore.DbContext
{
    [ConnectionStringName("Customconnstr")]
    public class CustomDbContext : AbpDbContext<CustomDbContext>
    {



        public DbSet<AGV_MPNVSPartnumber> AGV_MPNVSPartnumbers { get; set; }
        public DbSet<AGV_Packing_List_Verification> AGV_Packing_List_Verifications { get; set; }
        public DbSet<View_Packing_List> View_Packing_Lists { get; set; }
        public DbSet<AGV_Reel_Bonding> AGV_Reel_Bondings { get; set; }

        public DbSet<View_toAGV_Reel> View_ToAGV_Reels { get; set; }
        public DbSet<AGV_Kitted> AGV_Kitteds { get; set; }
        public DbSet<View_ToAGV_MatList> View_ToAGV_MatLists { get; set; }
        public CustomDbContext(DbContextOptions<CustomDbContext> options) : base(options)
        {


        }
        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            builder.Entity<AGV_Reel_Bonding>(b =>
            {
                b.ToTable("AGV_Reel_Bonding");
                b.Property(x => x.ReelType).HasColumnType("nvarchar(50)");
                b.Property(x=>x.PartnumberLotID).HasColumnType("nvarchar(50)");
            });
            builder.Entity<AGV_Kitted>(b =>
            {
                b.ToTable("AGV_Kitted");
            });
            builder.Entity<AGV_MPNVSPartnumber>(b =>
            {
                b.ToTable("AGV_MPNVSPartnumber");
            });
            builder.Entity<AGV_Packing_List_Verification>(b =>
            {
                b.ToTable("AGV_Packing_List_Verification");
            });
            builder.Entity<View_Packing_List>(b =>
            {
                b.ToTable("View_Packing_List").HasNoKey();
            });
            builder.Entity<View_toAGV_Reel>(b =>
            {
                b.ToTable("View_toAGV_Reel").HasNoKey();
            });
            builder.Entity<View_ToAGV_MatList>(b =>
            {
                b.ToTable("View_ToAGV_MatList").HasNoKey();
            });

        }
    }
}
